/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.util.ArrayList;
import java.net.*;


/**
 *
 * @author bangyo17
 */
public class PeerEntity{

    public String IP;
    final int MAX_PORT = 15;
    //public int peer_id;
    public int port;                                                        //port HTTP
    public ArrayList<pTCP> portTCP = new ArrayList<pTCP>();   //PORT TCP
    public boolean isDownloading = false;
    public boolean isActive = false;
    final int SPEED = 100000; //100 kbps
    public boolean isSeeder;

    public URL url;
    public URLConnection connection;
    //port TCP
    

    public PeerEntity(String IP, int port, boolean completed) {
        //this.peer_id = id;
        this.IP = IP;
        this.port = port;
        this.isSeeder = completed;
    }
     public void addPortTCP(int p, String service) {
        pTCP pr = new pTCP(p,service);
        this.portTCP.add(pr);
       // System.out.println(pr.port);
    }

    public void removePortTCP(int p) {
        this.portTCP.remove(p);
    }

}
